#pragma once

#include "Control/ControlInclude.h"
#include "Util/ResConfig.h"
#include "ZImprove/IResCfg.h"
#include "ProgressEx.h"
#include "CommandDef.h"

#include "VideoPlayer.h" 


#include <map>
using namespace std;




#define	   MAX_PRO				20

typedef map<DWORD,CNumberCtrl*>  MAP_NUMCTRL;


enum BIKE_SET_TYPE { BIKE_MANUAL,BIKE_PYRAMID,BIKE_HILLCLIMB,BIKE_INTERVAL,BIKE_RANDOM,BIKE_CONSWATTS,BIKE_HEARTRATE,BIKE_SET_ALL };




class CMainMenuPainter;

class CWorkOutCon : public CContainer
{
public:
	CWorkOutCon(HWND hWnd);
public:
	virtual ~CWorkOutCon(void);
	virtual BOOL InitControls(DWORD dwData);
	virtual void OnCommand(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);

	void	OnLangChange(  );
	void	ShowPauseBtn( BOOL bShowPause );

	BOOL	IsShowPauseBtn();

	BOOL	InitVideoList( wstring strOrder );
	void	SetCurPlayIndex( int nIndex );

	void	LoadSetting();
	void	GetAndSetPorValue( );

	void	OnTimer();
	void	SetCurExerciseTitle( BOOL bRest );



public:
	vector<wstring>				m_VecPlayList;
	vector<wstring>				m_VecTxtTile;


	int							m_nCurIndex;
#ifdef UNDER_CE
	CVideoPlayer*				m_pInterVideo;
#endif


public:
	CIResCfg		m_config;
	CCheckBtn*		m_pChbtnMute;
	CBmpBtn*		m_pBtnPause;
	CBmpBtn*		m_pBtnEnd;
	CPicture*		m_pPicVideo;
	CText*			m_pTxtTheme;


	CNumberCtrl*	m_pHeartRateNum;

	CNumberCtrl*	m_pNumThisCount;		
	CNumberCtrl*	m_pNumLastCount;		
	CNumberCtrl*	m_pNumTotalCount;		

	CTimeNumCtrl*	m_pTmNumDist;
	CTimeNumCtrl*	m_pTmNumMets;


	map<CControl*,wstring>		m_mapCtrlLang;
	map<DWORD,CNumberCtrl*>		m_mapNumCtrl;

	CTimeCtrl*				m_pTmIntver;
	CTimeCtrl*				m_pTmTotal;


protected:
	CProgressEx*		m_pProResistance[MAX_PRO];

	int					m_nThisCount;
	int					m_nLastCount;
	int					m_nTotalCount;
	int					m_nTickCount;

	int					m_nTickStep;

	int					m_nIntervalTime;

	int					m_nStep;


	SET_WKO_Info					m_WKO_SET;
	SET_USER_INFO					m_UserInfo;
	SET_PARAM_INFO					m_bikeInfo;

	double							m_dwCalories;
	DWORD							m_dwDiffLev;
	double							m_dDistance;

private:
	friend class CMainMenuPainter;


};
